export const state = {
  items:[]
}
const mutations = {
  ADD_CART(state,item) {
    state.items.push(item)
    console.log('加入成功')
  }
}
const actions = {
  async addcart_one() {
    console.log('请求')
    var rand = Math.random()*10
    setTimeout(() => {
      commit('ADD_CART',`${rand}`)
    }, 1000);
  },
  addcart_two() {
    console.log('请求')
    var rand = Math.random()*10
    commit('ADD_CART',`${rand}`)
  }
}
export default {
  namespaced: true,
  state,
  actions,
  mutations,

}